<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

jimport( 'joomla.application.component.view');

class LettermanViewCampaigns extends JView
{
	function display( $tpl = null )
	{
		global $mainframe, $option;
		
		// Make it beautifull
		$document = & JFactory::getDocument();
		$document->addStyleSheet('components/com_letterman/assets/letterman.css');

		$filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'c.title', 'cmd' );
		$filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' );
		$filter_campaign = $mainframe->getUserStateFromRequest( $option.'filter_campaign', 'filter_campaign', '', 'int' );
		$search	= $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' );
		$search	= JString::strtolower( $search );

		// Add a few toolbar buttons
		JToolBarHelper::title(   JText::_( 'Campaign Manager' ), 'massemail' );
		JToolBarHelper::publishList();
		JToolBarHelper::unpublishList();
		$bar = & JToolBar::getInstance('toolbar');
		$bar->appendButton( 'Popup', 'new', 'New',"index.php?option=com_letterman&view=campaign&layout=form");		
		$bar->appendButton( 'Popup', 'delete', 'Delete',"index.php?option=com_letterman&view=campaign&layout=deleteForm");				
		
		// Get stuff to display
		$this->assignRef('order_Dir', $filter_order_Dir);
		$this->assignRef('order', $filter_order);
		$this->assignRef('search', $search);
		$this->assignRef('user',JFactory::getUser());
		$this->assignRef('data', $this->get( 'Data'));
		$this->assignRef('pagination', $this->get( 'Pagination' ));
		
		// Off we go to the layout
		parent::display($tpl);
	}
}
?>
